/*
 * @Author: your name
 * @Date: 2021-10-16 10:02:59
 * @LastEditTime: 2021-10-16 10:19:19
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \luogu\动态规划\模板问题\复习代码\1164.cpp
 */
#include<iostream>
using namespace std;

int f[110][10010];
//开销j空间的方案数
int ff[10010];

int p[110];

int main(){
    int N,M;
    //种类 钱数
    cin >> N >> M;
    //0元只有不吃一种方案
    ff[0] = 1;
    for(int i=1; i<=N; i++){
        cin >> p[i];
        for(int j=0; j<=M; j++){
            //前i菜 j元有f[i][j]种方案
            if(j < p[i]) f[i][j] = f[i-1][j];
            if(j == p[i]) f[i][j] = f[i-1][j]+1;
            if(j > p[i]) f[i][j] = f[i-1][j]+f[i-1][j-p[i]];
        }

        for(int j=M; j>=p[i]; j--){
            ff[j] = ff[j]+ff[j-p[i]];
        }
    }
    cout << f[N][M] << endl;
    cout << ff[M] << endl;
    return 0;
}
